<?php
//添加团购页面
include("../common.inc.php");
InitGP(array("action")); //初始化变量全局返回
include("function_common.php");

$titlestr="添加团购劵信息";
//初始化对象
include(INC_PATH."/member.class.php");
$m=new memberclass();

if(empty($action)){
	
	//显示添加表单
	include("tpl/user_add.htm");
}elseif ($action=="save"){
	InitGP(array("uname","email","pwd","qq","tel","zip","address","score","money","Submit")); //初始化变量全局返回
	if(isset($uname)){
		//处理数据
		$uname=Char_cv($uname);
		$email=Char_cv($email);
		$uarray=array(
			"qq"=>$qq,
			"tel"=>$tel,
			"zip"=>$zip,
			"address"=>$address,
			"score"=>$score,
			"addtime"=>$timestamp,
			"lastlogin"=>$timestamp
		);
		$info=$m->reg($uname,$pwd,$email,$uarray);
		if($info=="OK"){
			showmsg("添加用户成功!","user_list.php");//成功
		}else showmsg($info,"-1");//出错！
	}else showmsg("缺少参数","-1");//出错！
}


?>